package com.example.agron.common.utils;

import lombok.Data;

import java.util.List;

@Data
public class PageChunk<T> {

    private List<T> content;
    private long total;
    private int totalPages;
    private int pageSize;
    private int pageNumber;
    private int numberOfElement;

    //默认页面容量为10
    public final static int NO_SIZE = 10;

    public PageChunk(){
        this.pageSize = NO_SIZE;
    }

    public PageChunk(List<T> content, long total, int totalPages, int pageSize, int pageNumber, int numberOfElement) {
        this.content = content;
        this.total = total;
        this.totalPages = totalPages;
        this.pageSize = pageSize;
        this.pageNumber = pageNumber;
        this.numberOfElement = numberOfElement;
    }

    public List<T> getContent() {
        return content;
    }

    public void setContent(List<T> content) {
        this.content = content;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public int getTotalPages() {
        return totalPages;
    }

    public void setTotalPages(int totalPages) {
        this.totalPages = totalPages;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(int pageNumber) {
        this.pageNumber = pageNumber;
    }

    public int getNumberOfElement() {
        return numberOfElement;
    }

    public void setNumberOfElement(int numberOfElement) {
        this.numberOfElement = numberOfElement;
    }
}
